﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Chitiettuyen.aspx.cs" Inherits="Moving03.WebForm10" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    &nbsp;&nbsp; <strong><strong style="color: #6666FF">&nbsp; CHI TIẾT TUYẾN</strong></strong><br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataKeyNames="Id_ChiTietChiPhi" DataSourceID="SqlDataSource1" 
        ForeColor="#333333" GridLines="None" 
          style="width:90%; margin:auto; text-align:center" AllowPaging="True" 
          >
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="Id_ChiTietChiPhi" HeaderText="Id_ChiTietChiPhi" 
                InsertVisible="False" ReadOnly="True" SortExpression="Id_ChiTietChiPhi" 
                Visible="False" />
            <asp:BoundField DataField="Id_ChiPhi" HeaderText="Id_ChiPhi" 
                SortExpression="Id_ChiPhi" Visible="False" />
            <asp:BoundField DataField="TrongLuong" HeaderText="Trọng Lượng" 
                SortExpression="TrongLuong" />
            <asp:BoundField DataField="GiaChuyenNhanh" HeaderText="Gía Chuyển Nhanh" 
                SortExpression="GiaChuyenNhanh" />
            <asp:BoundField DataField="GiaChuyenThuong" HeaderText="Giá Chuyển Thường" 
                SortExpression="GiaChuyenThuong" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:UPSConnectionString %>" 
        DeleteCommand="DELETE FROM [ChiTietChiPhiNuocNgoai] WHERE [Id_ChiTietChiPhi] = @Id_ChiTietChiPhi" 
        InsertCommand="INSERT INTO [ChiTietChiPhiNuocNgoai] ([Id_ChiPhi], [TrongLuong], [GiaChuyenNhanh], [GiaChuyenThuong]) VALUES (@Id_ChiPhi, @TrongLuong, @GiaChuyenNhanh, @GiaChuyenThuong)" 
        SelectCommand="SELECT * FROM [ChiTietChiPhiNuocNgoai] WHERE ([Id_ChiPhi] = @Id_ChiPhi) ORDER BY [TrongLuong]" 
        
          UpdateCommand="UPDATE [ChiTietChiPhiNuocNgoai] SET [Id_ChiPhi] = @Id_ChiPhi, [TrongLuong] = @TrongLuong, [GiaChuyenNhanh] = @GiaChuyenNhanh, [GiaChuyenThuong] = @GiaChuyenThuong WHERE [Id_ChiTietChiPhi] = @Id_ChiTietChiPhi" 
         >
        <DeleteParameters>
            <asp:Parameter Name="Id_ChiTietChiPhi" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Id_ChiPhi" Type="Int32" />
            <asp:Parameter Name="TrongLuong" Type="Double" />
            <asp:Parameter Name="GiaChuyenNhanh" Type="Double" />
            <asp:Parameter Name="GiaChuyenThuong" Type="Double" />
        </InsertParameters>
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="1" Name="Id_ChiPhi" 
                QueryStringField="ID" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="Id_ChiPhi" Type="Int32" />
            <asp:Parameter Name="TrongLuong" Type="Double" />
            <asp:Parameter Name="GiaChuyenNhanh" Type="Double" />
            <asp:Parameter Name="GiaChuyenThuong" Type="Double" />
            <asp:Parameter Name="Id_ChiTietChiPhi" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <div style="width:50px; margin:auto; margin-bottom:20px; margin-top:20px">
    <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Trở Ra" />
    </div>
</asp:Content>
